//
//  ICEWDPPageControl.m
//  ICEH5Bridge
//
//  Created by wujianrong on 2017/8/14.
//  Copyright © 2017年 wanda. All rights reserved.
//

#import "ICEEMPageControl.h"
#import "ICEUI.h"
#import "ICEJavaScriptBridge.h"
@implementation ICEEMPageControl
-(void)pageControl:(NSDictionary*)args
{
    NSDictionary* param = [args objectForKey:@"param"];
    NSString* action = [param objectForKey:@"action"];
    ICEWebInfo* vcinfo = [args objectForKey:@"vcinfo"];
    if ([action isEqualToString:@"reload"]) {
        if (vcinfo.webView) {
            if ([vcinfo.webView respondsToSelector:@selector(refreshWebView)]) {
                [vcinfo.webView performSelector:@selector(refreshWebView)];
            }
        }
    }
    if ([action isEqualToString:@"back"]) {
        if (vcinfo.webView) {
            if ([vcinfo.webView respondsToSelector:@selector(webBack)]) {
                [vcinfo.webView performSelector:@selector(webBack)];
            }
        }
    }
    if ([action isEqualToString:@"close"]) {
        if (vcinfo.webView) {
            if ([vcinfo.webView respondsToSelector:@selector(closeWebAction)]) {
                [vcinfo.webView performSelector:@selector(closeWebAction)];
            }
        }
    }
    NSDictionary* ret = nil;
    ret = @{
            @"status":@"success",
            };
    [ICEJavaScriptBridge sendReslutToJS:ret callInfo:args];
}
@end
